//获取结缘申请
let { love } = require("./love_schema.js");
module.exports = {
    getLove: function (req, res, err) {
        console.log(req.query);
        let user = req.query.user;
        let toUser = req.query.toUser;
        if(toUser){
            //判断toUser是否存在来判断获取申请结缘列表还是结缘信息
            love.find({ $or: [{ user, toUser }, { user: toUser, toUser: user }] }).then((data) => {
                res.send(data)
            })
        }else{
            love.find({user}).then((data) => {
                res.send(data)
            })
        }
        
    }
}